<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<c:set var="contextPath" value="${pageContext.request.contextPath}"></c:set>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/static/docs/style/css/index.css" />
<script type="text/javascript">
	// 通知服务员结账
	function callPay(node) {
		var orderId = node.lang;
		window.location.href = "${pageContext.request.contextPath}/jiezhang";
	}
</script>
<script type="text/javascript" src="My97DatePicker/WdatePicker.js"></script> 
</head>

<body style="text-align: center">

	<div id="all">
		<div id="menu">
			<!-- 餐车div -->
			<div id="count">
				<table align="center" width="100%">
					<tr>
						<td align="center" width="20%">菜名</td>
						<td align="center" width="20%">单价</td>
						<td align="center" width="20%">数量</td>
						<td align="center" width="20%">小计</td>
					</tr>

					<c:set value="0" var="sum" />
					<tr>
						<c:forEach items="${orderList}" var="order">
							<tr>

								<td align="center">${order.foodn.foodname}</td>


								<td align="center">${order.foodn.price}</td>

								<td align="center">${order.foodcount}</td>


								<td align="center">${order.foodcount*order.foodn.price}</td>

								<c:set value="${sum+order.foodcount*order.foodn.price}"
									var="sum" />

							</tr>
						</c:forEach>

					</tr>

					<form action="${orders.id}" method="post" modelAttribute="orders">
						<tr>

							<td colspan="6" align="right">总计: <span
								style="font-size: 36px;">&yen;</span> <input type="text"
								readonly name="totalprice" value="${sum}" />
							</td>
								<input type="text" readonly name="tableId" value="${orders.tableId}" style="display:none"/>
								<td colspan="6" align="right">状态:
								<c:choose>
									<c:when test="${orders.orderstatus==0 }">
										未付款
									</c:when>
									<c:otherwise>
										已付款
									</c:otherwise>
								</c:choose>
								 </td>
								
								<input type="text" readonly name="orderstatus" value="${orders.orderstatus}" style="display:none"/>
							

						</tr>
						<tr>
							<td colspan="6" style="margin-left: 100px; text-align: center;"
								align="right"><input type="hidden" name="bId" value="">
								<input type="submit" value="下单" class="btn_next"
								onclick="genernateOrder()" /></td>
						</tr>
					</form>


				</table>
			</div>
		</div>

		<!-- 右边菜系列表，菜品搜索框  -->
		<div id="dish_class">
			<div id="dish_top">
				<ul>
					<li class="dish_num"></li>
					<li><a
						href="${pageContext.request.contextPath}/xiadan/${orders.id}">
							<img
							src="${pageContext.request.contextPath}/static/docs/style/images/call2.gif" />
					</a></li>
				</ul>
			</div>

			<div id="dish_2">
				<ul>

					<c:forEach items="${foodTypeList1}" var="foodType">
						<li>
							<a
						href="${pageContext.request.contextPath}/caidan/${foodType.id}">${foodType.typename}</a>
							
						</li>
				</c:forEach>	

				</ul>
			</div>

		</div>

	</div>
</body>
</html>